home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / buzzmachines_massive.exe / Dev / Geoffroy Notefilter SourceCode / BuzzParameterUnit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-05-06  |  1.2 KB  |  54 lines

  1. // BuzzParameterUnit.cpp: implementation of the BuzzParameterUnit class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #include "BuzzParameterUnit.h"
  6.  
  7. //////////////////////////////////////////////////////////////////////
  8. // Construction/Destruction
  9. //////////////////////////////////////////////////////////////////////
  10.  
  11. byte BuzzParameterUnit::MIN_SLIDER_VALUE = BuzzParameterUnit_MS;
  12. byte BuzzParameterUnit::MAX_SLIDER_VALUE = BuzzParameterUnit_TICKS;
  13. byte BuzzParameterUnit::UNCHANGED_SLIDER_VALUE = 0;
  14. byte BuzzParameterUnit::INIT_SLIDER_VALUE = BuzzParameterUnit_MS;
  15.  
  16. BuzzParameterUnit::BuzzParameterUnit() : BuzzParameter<byte,byte>()
  17. {
  18.     setSliderValue(INIT_SLIDER_VALUE);
  19. }
  20.  
  21. BuzzParameterUnit::~BuzzParameterUnit()
  22. {
  23. }
  24.  
  25. void BuzzParameterUnit::compute()
  26. {
  27.     currentRealValue = currentSliderValue;
  28. }
  29.  
  30. char const * BuzzParameterUnit::toString(word const value)
  31. {
  32.     static char txt[50];
  33.     txt[0]=0;
  34.  
  35.     switch (value) {
  36.     case BuzzParameterUnit_SAMPLES:
  37.         sprintf(txt,"samples");
  38.         break;
  39.  
  40.     case BuzzParameterUnit_MS:
  41.         sprintf(txt,"ms");
  42.         break;
  43.  
  44.     case BuzzParameterUnit_TICKS:
  45.         sprintf(txt,"ticks");
  46.         break;
  47.  
  48.     default:
  49.         sprintf(txt,"error, no unity set");
  50.         break;
  51.     }
  52.  
  53.     return txt;
  54. }